home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak Vol A-4
/
(Vol A-4) Vol. A4.iso
/
Games
/
smashing.swf
/
scripts
/
frame_79
/
DoAction.as
Wrap
Text File
|
2008-03-12
|
2KB
|
43 lines
function bonusActions()
{
if(smashedBricks != totalBricks)
{
if(random(100) < randomBonusFactor && activeBrick.brickType != "bonus" && 0 < arrBonuses.length)
{
sndBonus.start();
randomBonus = random(arrBonuses.length);
bonusToActivate = arrBonuses[randomBonus];
if(bonusToActivate < 101)
{
_root.clipCounter = _root.clipCounter + 1;
bricks.attachMovie("mcBonus","mcBonus" + _root.clipCounter,clipCounter);
bricks["mcBonus" + _root.clipCounter].bonus.gotoAndStop(bonusToActivate);
bricks["mcBonus" + _root.clipCounter]._x = int(_root.bricks["brick" + i]._x);
bricks["mcBonus" + _root.clipCounter]._y = int(_root.bricks["brick" + i]._y);
bricks["brick" + i].swapDepths(bricks["mcBonus" + _root.clipCounter]);
totalBricks++;
}
else
{
_root.clipCounter = _root.clipCounter + 1;
_root.attachMovie("mcBonusFalling","mcBonusFalling" + _root.clipCounter,clipCounter);
_root["mcBonusFalling" + _root.clipCounter].bonus.gotoAndStop(bonusToActivate - 100);
_root["mcBonusFalling" + _root.clipCounter]._x = _root.bricks["brick" + i]._x;
_root["mcBonusFalling" + _root.clipCounter]._y = _root.bricks["brick" + i]._y;
}
arrBonuses.splice(randomBonus,1);
}
else if(ball.goldenBall && activeBrick.brickType != "bonus")
{
_root.clipCounter = _root.clipCounter + 1;
bricks.attachMovie("mcBonus","mcBonus" + _root.clipCounter,_root.clipCounter);
bricks["mcBonus" + _root.clipCounter].bonus.gotoAndStop(3);
bricks["mcBonus" + _root.clipCounter]._x = _root.bricks["brick" + i]._x;
bricks["mcBonus" + _root.clipCounter]._y = _root.bricks["brick" + i]._y;
bricks["brick" + i].swapDepths(bricks["mcBonus" + _root.clipCounter]);
totalBricks++;
}
}
}
gotoAndPlay(89);